//
//  MOFoodOrderListDetailViewCell.m
//  MobileOffice
//
//  Created by 冰冰 on 2019/10/18.
//  Copyright © 2019 com.idolmedia. All rights reserved.
//

#import "MOFoodOrderListDetailViewCell.h"

@interface MOFoodOrderListDetailViewCell ()

@property(nonatomic,strong)UIView *backView;

@property(nonatomic,strong)UILabel *canTingNameLabel;

@property(nonatomic,strong)UILabel *foodNameLabel;

@property(nonatomic,strong)UILabel *numberLabel;

@end

@implementation MOFoodOrderListDetailViewCell

- (MOFoodOrderListDetailViewCell *)cellCreat:(NSString *)cellIdentifier AndArray:(NSMutableArray *)array andTableView:(UITableView *)tableView cellIndexPath:(NSIndexPath *)indexPath andType:(NSInteger)type{
    YPBaseSwipeTableViewCell *cell  = [self initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier withBtn:array tableView:tableView cellIndexPath:indexPath andType:type];
    self.YPContentView.backgroundColor = KGrayColor_f8f8f8;
    [cell creatUI];
    return self;
}

- (void)creatUI{
    [self.YPContentView addSubview:self.backView];
}

-(void)setModel:(MOFoodOrderListDetailModel *)model
{
    self.canTingNameLabel.text = model.canTingNameStr;
    
    self.foodNameLabel.text = model.foodNameStr;
    
    self.numberLabel.text = [NSString stringWithFormat:@"*%@",model.numberStr];
}

#pragma mark -懒加载
- (UIView *)backView{
    if (!_backView) {
        _backView = [[UIView alloc] initWithFrame:CGRectMake(10, 0, SCREEN_WIDTH - 10*2, 80)];
        _backView.backgroundColor = KWhiteColor;
        
        _canTingNameLabel = [[UILabel alloc]initWithFrame:CGRectMake(18, 16, self.backView.width-36, 16)];
        _canTingNameLabel.font = [UIFont boldSystemFontOfSize:16];
        _canTingNameLabel.textColor = KBlackColor_2A2A2A;
        _canTingNameLabel.text = @"第一餐厅";
        [_backView addSubview:_canTingNameLabel];
        
        _foodNameLabel = [[UILabel alloc] initWithFrame:CGRectMake(18, _canTingNameLabel.bottom + 19, self.backView.width-36, 13)];
        _foodNameLabel.font = FONT_SIZE(13);
        _foodNameLabel.textColor = KBlackColor_2A2A2A;
        _foodNameLabel.text = @"手抓饭（中餐）";
        [_backView addSubview:_foodNameLabel];
        
        _numberLabel = [[UILabel alloc]initWithFrame:_foodNameLabel.frame];
        _numberLabel.textAlignment = NSTextAlignmentRight;
        _numberLabel.font = FONT_SIZE(13);
        _numberLabel.textColor = KBlackColor_2A2A2A;
        _numberLabel.text = @"*2";
        [_backView addSubview:_numberLabel];
    }
    return _backView;
}

@end
